'''
写信页面
 '''
from selenium.webdriver.common.by import By
from page.base_page import BasePage

class Tianjia(BasePage):
    url = 'http://192.168.1.25/crm/index.php?m=announcement&a=add'

    # 输入标题
    shurubiaoti_locator = (By.CSS_SELECTOR,'body > div.container > div.row > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) > input')
    # 输入内容
    nr_locator = (By.CSS_SELECTOR,'body > div.container > div.row > div > form > table > tbody > tr:nth-child(7) > td:nth-child(2) > div > div.ke-edit > iframe')
    # 点击保存
    baocun_locator = (By.CSS_SELECTOR, 'body > div.container > div.row > div > form > table > tfoot > tr > td > input.btn.btn-primary')

    def shurubiaoti(self,biaoti):
        self.driver.find_element(*self.shurubiaoti_locator).send_keys(biaoti)

    def shuruneirong(self,shuru):
        self.driver.find_element(*self.nr_locator).send_keys(shuru)

    def dianjibaocun(self):
        self.driver.find_element(*self.baocun_locator).click()


